Host Your Web Site in the Cloud by Jeff Barr

Host Your Web Site in the Cloud by Jeff Barr

Author:Jeff Barr [Barr, Jeff]
Language: eng
Format: epub, mobi, pdf
ISBN: 9780980576832
Publisher: SitePoint Pty Ltd
Published: 2010-08-16T04:00:00+00:00


Once all the thumbnail images have been rendered, we can upload the final image to S3:

chapter_06/render_images.php (excerpt)

$imageFileOut = tempnam('/tmp', 'aws') . '.png'; ImagePNG($imageOut, $imageFileOut, 0); $imageBitsOut = file_get_contents($imageFileOut); unlink($imageFileOut); $key = 'page_image_' . md5($pageTitle) . '.png'; if (uploadObject($s3, BOOK_BUCKET, $key, $imageBitsOut, S3_ACL_PUBLIC)) {

There’s just a little bit of cleanup work left, and we’re done. First of all, we need to report on the location of the final image. Then the message has to be deleted, and we can also display the processing history that we’ve maintained as the message has moved from stage to stage:

chapter_06/render_images.php (excerpt)

print(" Stored final image in S3 using key '${key}'\n"); print_r($messageDetail['History']); $sqs->delete_message($queueRender, $receiptHandle); print(" Deleted message from render queue\n"); } print("\n");



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.